package com.hongmeng.teamwork.enums;

public enum AttachmentEnum {
    IMAGE(0, "图片"),
    FILE(1, "文件"),
    ;

    private int code;
    private String desc;

    AttachmentEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static AttachmentEnum ofEnum(int code) {
        for (AttachmentEnum attachmentEnum : AttachmentEnum.values()) {
            if (attachmentEnum.code == code) {
                return attachmentEnum;
            }
        }
        return null;
    }
}
